From 48cbf355bd6f5b01cca660006da5cc5556e64c0f Mon Sep 17 00:00:00 2001 From: alexmot Date: Tue, 9 Mar 2004 22:18:53 +0000 Subject: [PATCH] Change OziExplorer output to write \r\n pairs instead of \n. --- gpsbabel/ozi.c | 38 +++++++++++++++++++------------------- gpsbabel/reference/ozi.wpt | 26 +++++++++++++------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/gpsbabel/ozi.c b/gpsbabel/ozi.c index 3de14fa1b..a2d5fbcd7 100644 --- a/gpsbabel/ozi.c +++ b/gpsbabel/ozi.c @@ -106,7 +106,7 @@ ozi_openfile(char *fname) { file_out = NULL; } - file_out = xfopen(tmpname, "w", MYNAME); + file_out = xfopen(tmpname, "wb", MYNAME); xfree(tmpname); @@ -117,12 +117,12 @@ static void ozi_track_hdr(const route_head * rte) { static char *ozi_trk_header = - "OziExplorer Track Point File Version 2.1\n" - "WGS 84\n" - "Altitude is in Feet\n" - "Reserved 3\n" - "0,2,255,ComplimentsOfGPSBabel,0,0,2,8421376\n" - "0\n"; + "OziExplorer Track Point File Version 2.1\r\n" + "WGS 84\r\n" + "Altitude is in Feet\r\n" + "Reserved 3\r\n" + "0,2,255,ComplimentsOfGPSBabel,0,0,2,8421376\r\n" + "0\r\n"; ozi_openfile(ozi_ofname); fprintf(file_out, ozi_trk_header); @@ -144,7 +144,7 @@ ozi_track_disp(const waypoint * waypointp) alt_feet = (waypointp->altitude * 3.2808); } - fprintf(file_out, "%.6f,%.6f,0,%.0f,%.5f,,\n", + fprintf(file_out, "%.6f,%.6f,0,%.0f,%.5f,,\r\n", waypointp->latitude, waypointp->longitude, alt_feet, ozi_time); } @@ -163,10 +163,10 @@ static void ozi_route_hdr(const route_head * rte) { static char *ozi_route_header = - "OziExplorer Route File Version 1.0\n" - "WGS 84\n" - "Reserved 1\n" - "Reserved 2\n"; + "OziExplorer Route File Version 1.0\r\n" + "WGS 84\r\n" + "Reserved 1\r\n" + "Reserved 2\r\n"; /* prologue on 1st pass only */ if (route_out_count == 0) { @@ -188,7 +188,7 @@ ozi_route_hdr(const route_head * rte) * R, 1, ICP GALHETA,, 16711680 */ - fprintf(file_out, "R,%d,%s,%s,\n", + fprintf(file_out, "R,%d,%s,%s,\r\n", route_out_count, rte->rte_name ? rte->rte_name : "", rte->rte_desc ? rte->rte_desc : ""); @@ -232,7 +232,7 @@ ozi_route_disp(const waypoint * waypointp) * W,1,7,7,007,-25.581670,-48.316660,36564.54196,10,1,4,0,65535,TR ILHA GALHETA,0,0 */ - fprintf(file_out, "W,%d,%d,,%s,%.6f,%.6f,%.5f,0,1,3,0,65535,%s,0,0\n", + fprintf(file_out, "W,%d,%d,,%s,%.6f,%.6f,%.5f,0,1,3,0,65535,%s,0,0\r\n", route_out_count, route_wpt_count, waypointp->shortname ? waypointp->shortname : "", @@ -650,7 +650,7 @@ ozi_waypt_pr(const waypoint * wpt) index++; fprintf(file_out, - "%d,%s,%.6f,%.6f,%.5f,%d,%d,%d,%d,%d,%s,%d,%d,%d,%.0f,%d,%d,%d\n", + "%d,%s,%.6f,%.6f,%.5f,%d,%d,%d,%d,%d,%s,%d,%d,%d,%.0f,%d,%d,%d\r\n", index, shortname, wpt->latitude, wpt->longitude, ozi_time, 0, 1, 3, 0, 65535, description, 0, 0, 0, alt_feet, 6, 0, 17); @@ -663,10 +663,10 @@ static void data_write(void) { static char *ozi_wpt_header = - "OziExplorer Waypoint File Version 1.1\n" - "WGS 84\n" - "Reserved 2\n" - "Reserved 3\n"; + "OziExplorer Waypoint File Version 1.1\r\n" + "WGS 84\r\n" + "Reserved 2\r\n" + "Reserved 3\r\n"; track_out_count = route_out_count = 0; diff --git a/gpsbabel/reference/ozi.wpt b/gpsbabel/reference/ozi.wpt index ea65058c4..5b3f02df7 100644 --- a/gpsbabel/reference/ozi.wpt +++ b/gpsbabel/reference/ozi.wpt @@ -1,13 +1,13 @@ -OziExplorer Waypoint File Version 1.1 -WGS 84 -Reserved 2 -Reserved 3 -1,GCEBB,35.972033,-87.134700,25569.00000,0,1,3,0,65535,Mountain Bike Heaven by susy1313,0,0,0,0,6,0,17 -2,GC1A37,36.090683,-86.679550,25569.00000,0,1,3,0,65535,The Troll by a182pilot & Family,0,0,0,0,6,0,17 -3,GC1C2B,35.996267,-86.620117,25569.00000,0,1,3,0,65535,Dive Bomber by JoGPS & family,0,0,0,0,6,0,17 -4,GC25A9,36.038483,-86.648617,25569.00000,0,1,3,0,65535,FOSTER by JoGPS & Family,0,0,0,0,6,0,17 -5,GC2723,36.112183,-86.741767,25569.00000,0,1,3,0,65535,Logan Lighthouse by JoGps & Family,0,0,0,0,6,0,17 -6,GC2B71,36.064083,-86.790517,25569.00000,0,1,3,0,65535,Ganier Cache by Susy1313,0,0,0,0,6,0,17 -7,GC309F,36.087767,-86.809733,25569.00000,0,1,3,0,65535,Shy's Hill by FireFighterEng33,0,0,0,0,6,0,17 -8,GC317A,36.057500,-86.892000,25569.00000,0,1,3,0,65535,GittyUp by JoGPS / Warner Parks,0,0,0,0,6,0,17 -9,GC317D,36.082800,-86.867283,25569.00000,0,1,3,0,65535,Inlighting by JoGPS / Warner Parks,0,0,0,0,6,0,17 +OziExplorer Waypoint File Version 1.1 +WGS 84 +Reserved 2 +Reserved 3 +1,GCEBB,35.972033,-87.134700,25569.00000,0,1,3,0,65535,Mountain Bike Heaven by susy1313,0,0,0,0,6,0,17 +2,GC1A37,36.090683,-86.679550,25569.00000,0,1,3,0,65535,The Troll by a182pilot & Family,0,0,0,0,6,0,17 +3,GC1C2B,35.996267,-86.620117,25569.00000,0,1,3,0,65535,Dive Bomber by JoGPS & family,0,0,0,0,6,0,17 +4,GC25A9,36.038483,-86.648617,25569.00000,0,1,3,0,65535,FOSTER by JoGPS & Family,0,0,0,0,6,0,17 +5,GC2723,36.112183,-86.741767,25569.00000,0,1,3,0,65535,Logan Lighthouse by JoGps & Family,0,0,0,0,6,0,17 +6,GC2B71,36.064083,-86.790517,25569.00000,0,1,3,0,65535,Ganier Cache by Susy1313,0,0,0,0,6,0,17 +7,GC309F,36.087767,-86.809733,25569.00000,0,1,3,0,65535,Shy's Hill by FireFighterEng33,0,0,0,0,6,0,17 +8,GC317A,36.057500,-86.892000,25569.00000,0,1,3,0,65535,GittyUp by JoGPS / Warner Parks,0,0,0,0,6,0,17 +9,GC317D,36.082800,-86.867283,25569.00000,0,1,3,0,65535,Inlighting by JoGPS / Warner Parks,0,0,0,0,6,0,17 -- 2.30.2